#ifndef __SCURVE_H__
#define __SCURVE_H__

#include "main.h"
#include "arm_math.h"

struct S_CURVE_TYPE
{
    float speedTar;
    float lastspeedTar;

    float accSet, a_accSet;

    float accDir, accTar;

    float a_accTemp;
    float a_accStepTemp, d_accStepTemp;

    float acc, j;
    float accT;
    float a_accStep, accStep;

    float out;

    uint16_t accCnt, accMaxCnt;

    uint8_t sta, acc_dec;


    float gain, offset;
    uint8_t useOut;
};

extern struct S_CURVE_TYPE sCurve0;
extern struct S_CURVE_TYPE sCurve1;

void SCurveProcess(struct S_CURVE_TYPE *sCurve);
void SCurveHardProcess(struct S_CURVE_TYPE *sCurve, const float tar);

#endif
